{% extends 'layout_account.html' %}

{% block h1 %}Your Account Profile{% endblock %}

{% block nav-profile %}<li class="active">Profile</li>{% endblock %}

{% block account-intro %}
<p class="narrow">
  This is your account for administrating
  {% for type in asset_types %}
    {% if forloop.last %}
      and {{ type.verbose_name_plural }}.
    {% else %}
      {{ type.verbose_name_plural }},
    {% endif %}
  {% endfor %}

  While the resources you create may be available for the world to see,
  your account itself is not publicly visible. Your username here does
  not necessarily need to match your username on any source repositories.
</p>
<p class="narrow">
  Your e-mail address will never be publicly visible, nor will it ever
  be distributed to third parties. It will only be used to help you recover
  lost passwords, and to notify you of events (such as project ownership
  disputes) when you specifically opt-in for such notifications.
</p>
{% endblock %}

{% block account-forms %}
<form action="/account/" method="post">
  <fieldset><legend>Personal Information</legend>
  <div class="form-row">
    <label for="id_username">Username:</label>
    <div class="field">{{ user.username|escape }}</div>
  </div>
  <div class="form-row">
    <label for="id_first_name">First name:</label>
    <input type="text" class="text" name="first_name" id="id_first_name" value="{{ profile_form.data.first_name|escape }}"/>
    <div class="error">{{ profile_form.errors.first_name.0 }}</div>
  </div>
  <div class="form-row">
    <label for="id_last_name">Last name:</label>
    <input type="text" class="text" name="last_name" id="id_last_name" value="{{ profile_form.data.last_name|escape }}"/>
    <div class="error">{{ profile_form.errors.last_name.0 }}</div>
  </div>
  <div class="form-row">
    <label for="id_email">E-mail address:</label>
    <input type="text" class="text" name="email" id="id_email" value="{{ profile_form.data.email|escape }}"/>
    <div class="error">{{ profile_form.errors.email.0 }}</div>
  </div>
  <div class="submit-row">
    <div>&raquo;</div> <input type="submit" name="change-profile" value="Save" />
  </div>
  </fieldset>
</form>

<form action="/account/" method="post">
  <fieldset><legend>Change Password</legend>
  <div class="form-row">
    <label for="id_old_password">Current password:</label>
    <input type="password" class="text" name="old_password" id="id_old_password" />
    <div class="error">{{ password_form.errors.old_password.0 }}</div>
  </div>
  <div class="form-row">
    <label for="id_new_password">New password:</label>
    <input type="password" class="text" name="new_password" id="id_new_password" />
    <div class="error">{{ password_form.errors.new_password.0 }}</div>
  </div>
  <div class="form-row">
    <label for="id_new_password2">Re-type new password:</label>
    <input type="password" class="text" name="new_password2" id="id_new_password2" />
    <div class="error">{{ password_form.errors.new_password2.0 }}</div>
  </div>
  <div class="submit-row">
    <div>&raquo;</div> <input type="submit" name="change-password" value="Save" />
  </div>
  </fieldset>
</form>
{% endblock %}
